from collections import deque
queue = deque(["Eric" , "John","Michael"])
queue.append("Terry")
queue.append("Graham")
# queue.popleft()
print(queue)
print(queue.popleft())
print(queue)
print('-'*40)
squares = []
for x in range(10):
    squares.append(x ** 2)
print(squares)
squalambda = list(map(lambda x: x**2 , range(10)))
print(squalambda)
squalist = [x**2 for x in range(10)]
print(squalist)
print('===='*20)

funsparam = [(x,y) for x in [1,2,3] for y in [3,1,4] if x !=y ]
print(funsparam)
combs = []
for x in [1,2,3]:
    for y in [3,1,4]:
        if x !=y:
            combs.append((x,y))
print(combs)

# cmobsLambda = list(map(lambda x in [1,2,3] , y in [3,1,4] : if x !=y ))
vec = [ -4  , -2 , 0 , 2 , 4]
vec1 = [x*2 for x in vec]
print(vec1)
vec2 = [x for x in vec if x > 0 ]
print(vec2)
vec3 = [abs(x) for x in vec]
print(vec3)
freshfruit = ['  banana   ' , '  loganberry  ' , 'passion fruit']
freshfruit1 = [weapon.strip() for weapon in freshfruit]
print(freshfruit1)

matrix = [[1,2,3,4] , [5,6,7,8] , [9,10,11,12], [13,14,15,16]]
matrixLie = [[row[i] for row in matrix] for i in range(4)]
print(matrixLie)
transposed = []
for i in range(4):
    transposed.append([row[i] for row in matrix])
print(transposed)

transposed1 = []
for i in range(4):
    trans_row = []
    for row in matrix:
        trans_row.append(row[i])
    transposed1.append(trans_row)
print('====+++==='* 10)
a = [-1 , 1, 66.25 , 444, 333, 12345]
del a[0]
print(a)
del a[2:4]
print(a)
del a[:]
print(a)
empty = ()
singleton = 'hello' ,
len(empty)
print(len(singleton))
